package com.taotao.rest.service.impl;

import com.taotao.mapper.TbContentMapper;
import com.taotao.pojo.TbContent;
import com.taotao.pojo.TbContentExample;
import com.taotao.rest.service.ContentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by mafuhua on 2017/9/29.
 */
@Service
public class ContentServiceImpl implements ContentService {
    @Autowired
    private TbContentMapper tbContentMapper;

    @Override
    public List<TbContent> getContentList(long categoryId) {

        TbContentExample tbContentExample = new TbContentExample();
        TbContentExample.Criteria criteria = tbContentExample.createCriteria();

        System.out.println(categoryId + "--------------");
        criteria.andCategoryIdEqualTo(categoryId);
        List<TbContent> tbItemParams = tbContentMapper.selectByExampleWithBLOBs(tbContentExample);

        return tbItemParams;

    }

}
